//
//  TitleTableViewCell.m
//  Travelmemory
//
//  Created by lanou3g on 16/3/31.
//  Copyright © 2016年 ABCD. All rights reserved.
//

#import "TitleTableViewCell.h"
// 宏定义
// 宽
#define Kwindth self.contentView.frame.size.width
// 高
#define kHeigth  self.contentView.frame.size.height

@implementation TitleTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self getData];
        
    }
    
    return self;
    
}

- (void)getData{
    
    self.titlename = [[UILabel alloc] initWithFrame:CGRectMake(0, 20, Kwindth, 30)];
    
    self.titlename.textAlignment = NSTextAlignmentCenter;
    
    self.destiontext = [[UILabel alloc] initWithFrame:CGRectMake(0, 60, Kwindth, 40)];
    
    self.destiontext.font = [UIFont systemFontOfSize:13];
    
    self.destiontext.textAlignment = NSTextAlignmentCenter;
    
    self.destiontext.numberOfLines = 0;
    
    self.detailTextLabel.backgroundColor = [UIColor grayColor];
    
    [self.contentView addSubview:_titlename];
    
    [self.contentView addSubview:_destiontext];
    
}
-(void)layoutSubviews{
    [super layoutSubviews];
    
    self.titlename.frame = CGRectMake(Kwindth * 0.05, 10, Kwindth*0.9, kHeigth * 0.3);
    
    self.destiontext.frame = CGRectMake(Kwindth * 0.05, kHeigth * 0.2, Kwindth*0.9, kHeigth * 0.8);
}
// 返回宽度
+(CGFloat)backWeight{
    
    return [UIScreen mainScreen].bounds.size.width * 0.9;
}
@end
